//go:build amd64 && !appengine// +build amd64,!appenginepackage roaring// The functions below are implemented in popcnt_avx2_amd64.s using AVX2.// They are only used when the CPU supports AVX2 (see useAVX2); otherwise the// pure-Go fallbacks in popcnt_slices.go are used. This keeps behavior identical// on every target: appengine and non-amd64 builds compile popcnt_generic.go// instead, and amd64 CPUs without AVX2 take the scalar path at runtime.//go:noescapefunc _hasAVX2() bool//go:noescapefunc _popcntSliceAVX2( []uint64) uint64//go:noescapefunc _popcntMaskSliceAVX2(, []uint64) uint64//go:noescapefunc _popcntAndSliceAVX2(, []uint64) uint64//go:noescapefunc _popcntOrSliceAVX2(, []uint64) uint64//go:noescapefunc _popcntXorSliceAVX2(, []uint64) uint64// useAVX2 selects the AVX2 assembly implementations when the running CPU// supports AVX2. It is evaluated once at package initialization.var useAVX2 = _hasAVX2()func popcntSlice( []uint64) uint64 {ifuseAVX2 {return_popcntSliceAVX2() }returnpopcntSliceGo()}func popcntMaskSlice(, []uint64) uint64 {ifuseAVX2 {return_popcntMaskSliceAVX2(, ) }returnpopcntMaskSliceGo(, )}func popcntAndSlice(, []uint64) uint64 {ifuseAVX2 {return_popcntAndSliceAVX2(, ) }returnpopcntAndSliceGo(, )}func popcntOrSlice(, []uint64) uint64 {ifuseAVX2 {return_popcntOrSliceAVX2(, ) }returnpopcntOrSliceGo(, )}func popcntXorSlice(, []uint64) uint64 {ifuseAVX2 {return_popcntXorSliceAVX2(, ) }returnpopcntXorSliceGo(, )}
The pages are generated with Goldsv0.8.7. (GOOS=linux GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu.
PR and bug reports are welcome and can be submitted to the issue list.
Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds.